import 'package:enterprise_v6_app/app/core/core.dart';
import 'package:enterprise_v6_app/app/modules/application/special_operation/special_list/job_ticket/common/common_work_detail_all/work_flow_chart/work_flow_chart_controller.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart';

///动火作业-流程图
class WorkFlowChartWidget extends StatelessWidget {
  WorkFlowChartWidget({required this.processEncoding, super.key});
  final String processEncoding;
  final controller = Get.put(WorkFlowChartController());

  @override
  Widget build(BuildContext context) {
    return GetBuilder(
        init: controller,
        initState: (_)  {
          controller.initDate(processEncoding);
        },
        builder: (_) {
          return Column(
            children: [
              AppGaps.vGap12,
              Container(
                height: 4.w,
                color: const Color(0xff587DF5),
              ),
              Expanded(
                child: InAppWebView(
                  initialUrlRequest: controller.url,
                  onWebViewCreated: controller.onWebViewCreated,
                ),
              ),
            ],
          );
        });
  }
}
